<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="com.beust.jcommander.internal.Maps" %>
<%@ page import="com.sita.payment.PaymentClient" %>
<%@ page import="com.sita.payment.enums.PayType" %>
<%@ page import="java.util.Map" %>
<%--
  Created by IntelliJ IDEA.
  User: dongliangyi
  Date: 2016/11/25
  Time: 16:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Map<String, String> params = Maps.newHashMap();
    params.put("notify_url", (String) request.getAttribute("notify_url"));
    params.put("trade_no", (String) request.getAttribute("trade_no"));
    params.put("price", (String) request.getAttribute("price"));
    params.put("reason", (String) request.getAttribute("reason"));

    JSONObject jsonObject = PaymentClient.getInstance().refund(PayType.ALIPAY_APP.value(), params);
    String sHtmlText = jsonObject.getString("refund_url");
    out.print(sHtmlText);
%>
</body>
</html>
